package com.app.repository.impl;

import com.app.model.main.SystemMessage;
import com.app.repository.interfaces.SystemMessageMapper;
import com.app.support.dao.MybatisDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Lichaojie on 2017/3/10. It's a beautiful day.
 */
@Repository
public class SystemMessageMapperImpl implements SystemMessageMapper {

    @Autowired
    private MybatisDao mybatisDao;

    @Override
    public int deleteByPrimaryKey(Long id){
        return mybatisDao.delete("com.app.dao.main.SystemMessageMapper",".deletePrimaryKey",id);
    }

    @Override
    public int insert(SystemMessage record){
        return mybatisDao.insert("com.app.dao.main.SystemMessageMapper", ".insert", record);
    }

    @Override
    public int insertSelective(SystemMessage record){
        return mybatisDao.insert("com.app.dao.main.SystemMessageMapper",".insertSelective",record);
    }

    @Override
    public SystemMessage selectByPrimaryKey(Long id){
        return mybatisDao.get("com.app.dao.main.SystemMessageMapper", ".selectByPrimaryKey", id);
    }

    @Override
    public int updateByPrimaryKeySelective(SystemMessage record){
        return mybatisDao.update("com.app.dao.main.SystemMessageMapper", ".updateByPrimaryKeySelective", record);
    }

    @Override
    public int updateByPrimaryKeyWithBLOBs(SystemMessage record){
        return mybatisDao.update("com.app.dao.main.SystemMessageMapper",".updateByPrimaryKeyWithBLOBs",record);
    }

    @Override
    public int updateByPrimaryKey(SystemMessage record){
        return mybatisDao.update("com.app.dao.main.SystemMessageMapper",".updateByPrimaryKey",record);
    }

    @Override
    public SystemMessage selectByParam(String time){
        return mybatisDao.get("com.app.dao.main.SystemMessageMapper",".selectByParam",time);
    }

    @Override
    public List<SystemMessage> getUnPushedSystemMessage(){
        return mybatisDao.getList("com.app.dao.main.SystemMessageMapper",".getUnPushedSystemMessage");
    }
}
